All Questions
Tagged with scalaimmutability
6 questions
3votes
3answers
574views
Does variance make sense in a fully immutable language?
In many OOP programming languages, types can be made co-, contra- or in- variant. Most (if not all of these languages) are able to let variables be mutated in place, i.e. they are not fully immutable ...
2votes
2answers
1kviews
Why does an immutable object in Scala need less memory than a mutable one?
In Programming in Scala, there is this statement: For instance an empty mutable map in its default representation of HashMap takes up about 80 bytes and about 16 more are added for each entry that’s ...
0votes
0answers
1kviews
Controllers passing Request objects to backend logic that forward Request data: Good or Bad?
Currently working on a server-side front-end Scala Play app that does a lot of grabbing of HTML snippets and JSON from many other web apps before piecing everything together and sending it in a ...
6votes
3answers
2kviews
Decreasing vars in Scala programs
I have been studying scala for the past week or so and the ideologies associated with it and functional programming in general. As expected, the leap from imperative to functional programming is not ...
15votes
1answer
5kviews
Why does appending to a List in Scala have O(n) time complexity?
I just read that the execution time of the append operation for a List (:+) grows linearly with the size of the List. Appending to a List seems like a pretty common operation. Why should the ...
68votes
5answers
27kviews
When is it NOT good to use actors in akka/erlang?
I've been working with akka for 7-8 months now daily. When I started, I would be working on applications and notice that actors would be used basically anywhere once inside the actor system for ...